package com.mku.parkingmanagement_service.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mku.parkingmanagement_service.entity.Car;
import com.mku.parkingmanagement_service.entity.Stall;
import com.mku.parkingmanagement_service.mapper.CarMapper;
import com.mku.parkingmanagement_service.mapper.StallMapper;
import com.mku.parkingmanagement_service.service.CarService;
import com.mku.parkingmanagement_service.vo.StallCarVo;
import com.mku.parkingmanagement_service.vo.comm.ResultVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @className: CarServiceImpl
 * @author: Maoxx
 * @date: 2024/11/9 12:13
 * @Version: 1.0
 * @description:
 */

@Service
public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements CarService {
    @Resource
    private StallMapper stallMapper;

    @Override
    public ResultVO<Object> getCars(StallCarVo stallCarVo) {
        Page<Stall> page = new Page<>(stallCarVo.getPagenum(), stallCarVo.getPageSize());
        return ResultVO.success(stallMapper.getStallAll(page,stallCarVo.getNike(),stallCarVo.getCard()));
    }
}
